package com.wasion.pwportable.protocol.analyzer.terminal;

import com.wasion.pwportable.protocol.Protocol;
import com.wasion.pwportable.protocol.analyzer.AbstractAnalyzer;

public class AreaCode_RD_Analyzer extends AbstractAnalyzer {

	@Override
	public void dataAnalysis(String ackBS) {

		String dataType = ackBS.substring(DATATPYESTARTBIT, DATATPYENDBIT);

		// String dataLen = ackBS.substring(DATALENGTHSTARTBIT,
		// DATALENGTHENDBIT); // 16进制的数据长度

		if (dataType.equalsIgnoreCase(Protocol.T_AREA_CODE_RD)) {

			String data = ackBS.substring(DATABITSTART, DATABITSTART + 8);
			result.setT_Address_RD(data.substring(2, 4) + data.substring(0, 2)
					+ data.substring(6, 8) + data.substring(4, 6));
		}
	}
}
